import Http from "@/http"

export function pageApi(params:any) {
    return Http.post('officialUser/page', params)
}

export function saveApi(params:any) {
    return params.id ? Http.put('officialUser/update', params) : Http.post('officialUser/add', params)
}

export function listApi() {
    return Http.get('merchant/list')
}

export function deleteApi(id) {
    return Http.delete('merchant/delete/' + id)
}

export function restpwdApi(id:number, password:string) {
    return Http.put('merchant/resetpwd', { id, password })
}

export async function queryMerchantApi(name:string) {
    const r = await Http.get<any[]>('merchant/query?name=' + name)
    return r.data
}